<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        function Person() {

        }
        var person = new Person()
        console.log(person);
        console.log(Person.prototype);

        Grand.prototype.lastName = 'li'
        function Grand() {

        }
        var grand = new Grand()

        Father.prototype = grand
        function Father() {
            this.name = 'jiajun'
            this.fortune = {
                card1:'visa'
        }
        this.num = 100
    }
        var father = new Father()

        Son.prototype = father
        function Son() {
            this.hobbit = 'reading'
        }
        var son = new Son()
        // console.log(son.name); //jiajun
        // console.log(son.lastName);// li
        son.fortune.card2 = 'master'
        console.log(son.fortune);
        son.num++
        console.log(father.num); // 引用值修改
        console.log(son.num);
    </script>
</body>
</html>